﻿using System;

using System.Windows.Forms;
using System.Data.SqlServerCe;

namespace OutlookAddIn_Collaboratori
{
    //окно выбора пользователя
    public partial class User : Form
    {
        public User(AddinSattings satting)
        {
            m_satting = satting;
            InitializeComponent();
        }

        private AddinSattings m_satting;


        private void bSave_Click(object sender, EventArgs e)
        {
            m_satting.UserName = tName.Text;
            m_satting.Password = tPassword.Text;
            m_satting.Domian = tDomen.Text;
            Close();
        }

        private void bCencal_Click(object sender, EventArgs e)
        {
            Close();
        }

        private void User_Load(object sender, EventArgs e)
        {
            tName.Text = m_satting.UserName;
            tPassword.Text = m_satting.Password;
            tDomen.Text = m_satting.Domian;
        }

        private void tName_TextChanged(object sender, EventArgs e)
        {
            bSave.Enabled = true;
        }

        private void tDomen_TextChanged(object sender, EventArgs e)
        {
            bSave.Enabled = true;
        }

        private void tPassword_TextChanged(object sender, EventArgs e)
        {
            bSave.Enabled = true;
        }

        private void showPassword_CheckedChanged(object sender, EventArgs e)
        {
            char c = new char();// '3';
            if (!showPassword.Checked)
                c='*';

            tPassword.PasswordChar = c;
        }
    }
}
